<%@page import="com.jcp.entity.Notices"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!doctype html>
<html lang="en">
<head>
	
    <meta charset="UTF-8">
    <title>人事部管理系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="backstageCSSandJS/css/font.css">
    <link rel="stylesheet" href="backstageCSSandJS/css/xadmin.css">
    <link rel="stylesheet" href="https://cdn.bootcss.com/Swiper/3.4.2/css/swiper.min.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="https://cdn.bootcss.com/Swiper/3.4.2/js/swiper.jquery.min.js"></script>
    <script src="backstageCSSandJS/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="backstageCSSandJS/js/xadmin.js"></script>


</head>
<body>
    <!-- 顶部开始 -->
    <div class="container">
        <div class="logo"><a href="ns.do?op1=zhexiandenglu">JCP人事管理系统</a></div>
        <div class="open-nav"><i class="iconfont">&#xe699;</i></div>
        <ul class="layui-nav right" lay-filter="">
          <li class="layui-nav-item">
            <a href="javascript:;">admin</a>
            <dl class="layui-nav-child"> <!-- 二级菜单 -->
              <dd><a href="login.jsp">切换帐号</a></dd>
              <dd><a href="login.jsp">退出</a></dd>
            </dl>
          </li>
          
        </ul>
    </div>
    <!-- 顶部结束 -->
    <!-- 中部开始 -->
    <div class="wrapper">
        <!-- 左侧菜单开始 -->
        <div class="left-nav">
          <div id="side-nav">
            <ul id="nav">
                <li class="list" current>
                    <a href="javascript:;">
                        <i class="iconfont">&#xe761;</i>
                        公告管理
                        <i class="iconfont nav_right">&#xe697;</i>
                    </a>
                    <ul class="sub-menu">
                        <li>
                            <a href="ns.do?op1=login">
                                <i class="iconfont">&#xe6a7;</i>
                                	公告列表
                            </a>
                            
                        </li>
                    </ul>
                </li>
                <li class="list">
                    <a href="javascript:;">
                        <i class="iconfont">&#xe70b;</i>
                        员工管理
                        <i class="iconfont nav_right">&#xe697;</i>
                    </a>
                    <ul class="sub-menu">
                        <li>
                            <a href="ns.do?op1=Usersel">
                                <i class="iconfont">&#xe6a7;</i>
                                	员工列表
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="list" >
                    <a href="javascript:;">
                        <i class="iconfont">&#xe6a3;</i>
                        岗位管理
                        <i class="iconfont nav_right">&#xe697;</i>
                    </a>
                    <ul class="sub-menu">
                        <li>
                            <a href="ns.do?op1=postSel">
                                <i class="iconfont">&#xe6a7;</i>
                             	  岗位列表
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="list" >
                    <a href="javascript:;">
                        <i class="iconfont">&#xe6a3;</i>
                        部门管理
                        <i class="iconfont nav_right">&#xe697;</i>
                    </a>
                    <ul class="sub-menu" style="display:none">
                        <li>
                            <a href="ns.do?op1=deptsel">
                                <i class="iconfont">&#xe6a7;</i>
                         	      部门列表
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="list" >
                    <a href="javascript:;">
                        <i class="iconfont">&#xe6a3;</i>
                        档案管理
                        <i class="iconfont nav_right">&#xe697;</i>
                    </a>
                    <ul class="sub-menu" style="display:none">
                       <!--  <li>
                            <a href="files_1.jsp">
                                <i class="iconfont">&#xe6a7;</i>
                          	      添加档案
                            </a>
                        </li> -->
                        <li>
                            <a href="ns.do?op1=filesminsel">
                                <i class="iconfont">&#xe6a7;</i>
                          	      查看档案
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="list" >
                    <a href="javascript:;">
                        <i class="iconfont">&#xe6a3;</i>
                        考勤管理
                        <i class="iconfont nav_right">&#xe697;</i>
                    </a>
                    <ul class="sub-menu" style="display:none">
                        <li>
                            <a href="ns.do?op1=zhousel">
                                <i class="iconfont">&#xe6a7;</i>
                           	     考勤统计图
                            </a>
                        </li>

                    </ul>
                </li>

            </ul>
          </div>
        </div>
        <!-- 左侧菜单结束 -->
        <!-- 右侧主体开始 -->
        <div class="page-content">
          <div class="content">
            <!-- 右侧内容框架，更改从这里开始 -->
            <form class="layui-form xbs" action="ns.do?op1=select" method="post"  >
                <div class="layui-form-pane" style="text-align: center;">
                  <div class="layui-form-item" style="display: inline-block;">
                    
                    <div class="layui-input-inline">
                      <input type="text" name="username2" id="username2"  placeholder="查询公告" autocomplete="off" class="layui-input" value="${sessionScope.strLike}">
                   		
                    </div>
                    <div class="layui-input-inline" style="width:80px">
                        <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
                    </div>
                  </div>
                </div> 
            </form>
           
            <xblock>
           
            <button class="layui-btn" onclick="member_add('添加公告','Notices_1-add.jsp','400','400')"><i class="layui-icon">&#xe608;</i>添加</button>
            
            </xblock>
            
            <table class="layui-table">
                <thead>
                    <tr>
                        <th>
                             公告编号
                        </th>
                        <th>
                            公告内容
                        </th>
                        <th>
                            公告时间
                        </th>
                		<th>
                            公告操作
                        </th>
                    </tr>
                </thead>
                <tbody>
                	<!-- 判断响应参数数据是否为空 -->

		<c:if test="${requestScope.notices!=null}">
			<c:forEach  var="notices" items="${requestScope.notices.data}">
					<tr>

        <td>
            ${notices.notId}
            
        </td>
        <td >
            ${notices.notContent}
        </td>

        <td class="td-status">
            <!-- <div id = "div01"> -->
            ${notices.notTime}
            <!-- </div> -->
        </td>
        <td class="td-manage">
            
            <a title="编辑" href="javascript:;" onclick="member_edit('编辑','Notices_1-edit.jsp?NoticesId=${notices.notId}&NoticesContent=${notices.notContent}&NoticesTime=${notices.notTime}','4','','510')"
            class="ml-5" style="text-decoration:none" id="update">

                <i class="layui-icon">&#xe642;</i>
            </a>
            <a title="删除" href="javascript:;" onclick="member_del(this,'${notices.notId}')" 
            style="text-decoration:none">
                <i class="layui-icon">&#xe640;</i>
            </a>
        </td>
    </tr>
			</c:forEach>
		</c:if>
								<!-- 遍历响应数据 -->


                </tbody>
            </table>
            <!-- 右侧内容框架，更改从这里结束 -->
             <div id="demo2"></div>
          </div>
        </div>
        <!-- 右侧主体结束 -->
    </div>
    <!-- 中部结束 -->
    <!-- 底部开始 -->
     <div class="footer">
        <div class="copyright">Copyright ©2019 人事管理系统 v3.3 All Rights Reserved. 本后台系统由JCP小队提供技术支持</div>  
    </div>
    <!-- 底部结束 -->
    <!-- 背景切换开始 -->
    <div class="bg-changer">
        <div class="swiper-container changer-list">
            <div class="swiper-wrapper">
                <div class="swiper-slide"><img class="item" src="backstageCSSandJS/images/a.jpg" alt=""></div>
                <div class="swiper-slide"><img class="item" src="backstageCSSandJS/images/b.jpg" alt=""></div>
                <div class="swiper-slide"><img class="item" src="backstageCSSandJS/images/c.jpg" alt=""></div>
                <div class="swiper-slide"><img class="item" src="backstageCSSandJS/images/d.jpg" alt=""></div>
                <div class="swiper-slide"><img class="item" src="backstageCSSandJS/images/e.jpg" alt=""></div>
                <div class="swiper-slide"><img class="item" src="backstageCSSandJS/images/f.jpg" alt=""></div>
                <div class="swiper-slide"><img class="item" src="backstageCSSandJS/images/g.jpg" alt=""></div>
                <div class="swiper-slide"><img class="item" src="backstageCSSandJS/images/h.jpg" alt=""></div>
                <div class="swiper-slide"><img class="item" src="backstageCSSandJS/images/i.jpg" alt=""></div>
                <div class="swiper-slide"><img class="item" src="backstageCSSandJS/images/j.jpg" alt=""></div>
                <div class="swiper-slide"><img class="item" src="backstageCSSandJS/images/k.jpg" alt=""></div>
                <div class="swiper-slide"><span class="reset">初始化</span></div>
            </div>
        </div>
        <div class="bg-out"></div>
        <div id="changer-set"><i class="iconfont">&#xe696;</i></div>   
    </div>
   
    <!-- 背景切换结束 -->
    <!-- 页面动态效果 -->
    <script>
         /*用户-添加*/
        function member_add(title,url,w,h){
        	if (title == null || title == '') {
                title=false;
            };
            if (url == null || url == '') {
                url="404.html";
            };
            if (w == null || w == '') {
                w=800;
            };
            if (h == null || h == '') {
                h=($(window).height() - 50);
            };
            layer.open({

                type: 2,
                area: [w+'px', h +'px'],
                fix: false, //不固定
                maxmin: true,
                shadeClose: true,
                shade:0.4,
                title: title,
                content: url,
                anim: 3,
                success : function(data){
                	
                }
            });
         }
        
        /*用户-查看*/
        function member_show(title,url,id,w,h){
            x_admin_show(title,url,w,h);
        }
        // 用户-编辑
        function member_edit (title,url,id,w,h) {
        	 if (title == null || title == '') {
        	        title=false;
        	    };
        	    if (url == null || url == '') {
        	        url="404.html";
        	    };
        	    if (w == null || w == '') {
        	        w=800;
        	    };
        	    if (h == null || h == '') {
        	        h=($(window).height() - 50);
        	    };
        	    layer.open({
        	        type: 2,
        	        area: [w+'px', h +'px'],
        	        fix: false, //不固定
        	        maxmin: true,
        	        shadeClose: true,
        	        shade:0.4,
        	        title: title,
        	        content: url,
        	        success:function(data){
        	        	
        	        	/* var index = parent.layer.getFrameIndex(window.name); */
        	           /* parent.layer.close(index);*/
        	           
        	        }
        	    }); 
        }
        /*密码-修改*/
        function member_password(title,url,id,w,h){
            x_admin_show(title,url,w,h);  
        }
        /*用户-删除*/
        function member_del(obj,id){
        
            layer.confirm('确认要删除吗？',function(index){
				
                //发异步删除数据
                $.ajax({
				type:"post",
				url:"ns.do?op1=NoticesDel&NoticesId="+id
				,async:true
				,success:function(data){
					layer.msg('已删除!',{icon:1,time:1000});
					$(obj).parents("tr").remove();
					}
                });
					});

        }
        </script>
        <!-- 分页开始 -->
        <script src="backstageCSSandJS/layui/layui.js" charset="utf-8"></script>
        <script>
			layui.use(['laypage', 'layer'], function(){
				
  				var laypage = layui.laypage
  				,layer = layui.layer;
  		laypage({
	    		cont: 'demo2'//装载分页的容器
	    		,pages:${notices.totalPage}//一共有几页
	    		  //当前页数
	    		,curr:${notices.page}
	    		,skin: '#1E9FFF'//控制分页皮肤
	    		
	    		,jump: function(data,first){

	    			if(!first){
	    				location.href="ns.do?op1=login&curr="+data.curr+"&username2="+document.getElementById("username2").value;
	    			}
	    		}
	  		});
			});
			
        <!-- 分页结束 -->
        </script>
</body>
</html>